package mymail;

import java.security.MessageDigest;

import org.bouncycastle.util.encoders.Base64;

public class Hash {

	private final static String ALGORITHM = "md5";

	public static byte[] hashData(String data) throws Exception {
		MessageDigest md = MessageDigest.getInstance(ALGORITHM);
		byte[] digestOfData = md.digest(Base64.decode(data.getBytes("utf-8")));

		return digestOfData;
	}
}
